
// var host = 'http://10.10.107.5:8000/'; // 本地测试环境

var host = location.ancestorOrigins[0];


var portal = host + '/portal/';
var coaapi = host + '/coaapi/';

window.APIS = {

    'login': portal + 'system/login',
    'tenants': portal + 'tenants/current',
    'role': portal + 'role/select',
    'getTaskInfo': coaapi + 'api/17/job/',
    'getTaskNodes': coaapi + 'api/17/project/zaibei/resources'

};


var pramas = location.href.split('?')[1].split('&');

var pramasHash = {};

for(var i = 0; i < pramas.length; i++){

    var prama = pramas[i].split("=");

    var name = prama[0];

    prama.splice(0,1);

    pramasHash[name] = prama.join('=');

}

sessionStorage.setItem('token' , pramasHash['token']);
sessionStorage.setItem('userid' , pramasHash['userId']);

window.UserConfig = {
    token: pramasHash['token'],
    userid: pramasHash['userId']
};